import Vue from "vue";
import Router from "vue-router";
import Generator from "@/views/Generator/Generator";
import store from "@/store";

import utils from "@/assets/js/utils";

import {getIFramePath, getIFrameUrl} from "@/utils/iframe";

Vue.use(Router);

const VueRouterPush = Router.prototype.push;
Router.prototype.push = function push(to) {
  return VueRouterPush.call(this, to).catch(err => err);
};

const white_url = [
  "/404",
  "/registe",
  "/KaaosiLogin",
  "/SinglePointLogin",
  "/terminal"
];

const router = new Router({
  mode: "hash",
  routes: [
    {
      path: "/",
      name: "首页",
      component: resolve => require(["@/views/Home"], resolve),
      children: [
        {
          path: "/",
          name: "首页",
          component: resolve => require(["@/views/Intro/Intro"], resolve),
          meta: {
            icon: "iconfont icon-zhuye1",
            index: 0
          }
        },
        {
          path: '/MEffectProductDetail/',
          name: '获取置顶商品表详情',
          component: resolve => require(['@/views/Pages/Product/MEffectProductDetail'], resolve)
        },
        {
          path: '/MEffectProductListEdit/',
          name: '编辑置顶商品',
          component: resolve => require(['@/views/Pages/Product/MEffectProductListEdit'], resolve) },
        // ===============================营销模块，打包发布的时候，需要释放 updated by tzc at 2020-10-15 10:10:48 start==================================
        //   {
        //     path: '/QueryPromotion',
        //     name: '促销活动详情',
        //     component: resolve => require(['@/views/Pages/PromotionManagement/QueryPromotion'], resolve)
        //   }, {
        //     path: '/QueryPromotion2',
        //     name: '促销活动详情',
        //     component: resolve => require(['@/views/Pages/PromotionManagement/QueryPromotion2'], resolve)
        //   }, {
        //     path: '/QueryRedemptionPromotion',
        //     name: '换购活动详情',
        //     component: resolve => require(['@/views/Pages/PromotionManagement/QueryRedemptionPromotion'], resolve)
        //   }, {
        //     path: '/CreateRedemption',
        //     name: '创建换购活动',
        //     component: resolve => require(['@/views/Pages/PromotionManagement/CreateRedemption'], resolve)
        //   },
        {
            path: '/ComplexPromotionCreate/:id/:active',
            name: '创建组合促销活动',
            component: resolve => require(['@/views/Pages/PromotionManagement/ComplexPromotionCreate'], resolve)
          },{
            path: '/QueryHandselPromotion',
            name: '买赠活动详情',
            component: resolve => require(['@/views/Pages/PromotionManagement/QueryHandselPromotion'], resolve)
          }, {
            path: '/QueryCombinationPromotion',
            name: '组合活动详情',
            component: resolve => require(['@/views/Pages/PromotionManagement/QueryCombinationPromotion'], resolve)
          },
        //{
        //     path: '/CreatePromotion',
        //     name: '创建活动',
        //     component: resolve => require(['@/views/Pages/PromotionManagement/CreatePromotion'], resolve)
        //   }, {
        //     path: '/SecKillPromotionDetail',
        //     name: '秒杀详情统计',
        //     component: resolve => require(['@/views/Pages/PromotionManagement/SecKillPromotionDetail'], resolve)
        //   }, {
        //     path: '/CreateGrouponDetail',
        //     name: '拼团详情统计',
        //     component: resolve => require(['@/views/Pages/PromotionManagement/CreateGrouponDetail'], resolve)
        //   }, {
        //     path: '/FullPromotionDetail',
        //     name: '满额促销详情统计',
        //     component: resolve => require(['@/views/Pages/PromotionManagement/FullPromotionDetail'], resolve)
        //   }, {
        //     path: '/pages/promotionManagement/statementAnalysis',
        //     name: '年度活动报表分析',
        //     component: resolve => require(['@/views/Pages/PromotionManagement/statementAnalysis'], resolve)
        //   }, {
        //     path: '/pages/promotionManagement/monthAnalysis',
        //     name: '月度活动报表分析',
        //     component: resolve => require(['@/views/Pages/PromotionManagement/monthAnalysis'], resolve)
        //   },
         {
            path: '/presellPromotionEvent',
            name: '创建预售活动',
            component: resolve => require(['@/views/Pages/PromotionManagement/presellPromotionEvent'], resolve)
          }, {
            path: '/presellPromotionEventUpdate',
            name: '编辑预售活动',
            component: resolve => require(['@/views/Pages/PromotionManagement/presellPromotionEventUpdate'], resolve)
          }, {
            path: '/QueryPresellPromotion',
            name: '预售活动详情页',
            component: resolve => require(['@/views/Pages/PromotionManagement/QueryPresellPromotion'], resolve)
          },
        //    {
        //     path: '/LotteryRuleEventUpdate',
        //     name: '编辑抽奖活动',
        //     component: resolve => require(['@/views/Pages/PromotionManagement/LotteryRuleEventUpdate'], resolve)
        //   },
        {
          path: '/LotteryRuleInfo/:id',
          name: '抽奖活动详情',
          component: resolve => require(['@/views/Pages/PromotionManagement/LotteryRuleInfo'], resolve)
        },
        // {
        //     path: '/AdditionProduct',
        //     name: '追加商品',
        //     component: resolve => require(['@/views/Pages/PromotionManagement/AdditionProduct'], resolve)
        //   }, {
        //     path: '/CreateHandsel',
        //     name: '创建赠送活动',
        //     component: resolve => require(['@/views/Pages/PromotionManagement/CreateHandsel'], resolve)
        //   }, {
        //     path: '/MarketingReport',
        //     name: '查看营销报告',
        //     component: resolve => require(['@/views/Pages/PromotionManagement/MarketingReport'], resolve)
        //   }, {
        //     path: '/CreatePromotion3',
        //     name: '促销活动详情',
        //     component: resolve => require(['@/views/Pages/PromotionManagement/CreatePromotion3'], resolve)
        //   }, {
        //     path: '/QueryPromotion3',
        //     name: '促销活动详情',
        //     component: resolve => require(['@/views/Pages/PromotionManagement/QueryPromotion3'], resolve)
        //   }, {
        //     path: '/CreatePromotionForFull',
        //     name: '满量活动',
        //     component: resolve => require(['@/views/Pages/PromotionManagement/CreatePromotionForFull'], resolve)
        //   }, {
        //     path: '/QueryPromotionForFull',
        //     name: '促销活动详情',
        //     component: resolve => require(['@/views/Pages/PromotionManagement/QueryPromotionForFull'], resolve)
        //   },
        {
            path: '/GroupDetailPromotion',
            name: '拼团活动详情',
            component: resolve => require(['@/views/Pages/PromotionManagement/GroupDetailPromotion'], resolve)
          },
          //  {
        //     path: '/CreatePromotionFullNum',
        //     name: '创建满量活动',
        //     component: resolve => require(['@/views/Pages/PromotionManagement/CreatePromotionFullNum'], resolve)
        //   }, {
        //     path: '/QueryPromotionFullNum',
        //     name: '满量活动详情',
        //     component: resolve => require(['@/views/Pages/PromotionManagement/QueryPromotionFullNum'], resolve)
        //   },
        {
            path: '/SinglePromotionDetail/:id/:auth',
            name: '单一活动详情', //GiftPromotionDetail
            component: resolve => require(['@/views/Pages/PromotionManagement/SinglePromotionDetail'], resolve)
          }, {
            path: '/SinglePromotionCreate',
            name: '创建单一活动',
            component: resolve => require(['@/views/Pages/PromotionManagement/SinglePromotionCreate'], resolve)
          }, {
            path: '/PaymentPromotionCreate',
            name: '创建支付立减活动',
            component: resolve => require(['@/views/Pages/PromotionManagement/PaymentPromotionCreate'], resolve)
          }, {
            path: '/PaymentDetail/:id/:auth',
            name: '支付立减活动详情',
            component: resolve => require(['@/views/Pages/PromotionManagement/PaymentDetail'], resolve)
          },

        //{
        //     path: '/BargainPromotionCreate',
        //     name: '创建砍价活动',
        //     component: resolve => require(['@/views/Pages/PromotionManagement/BargainPromotionCreate'], resolve)
        //   },{
        //     path: '/BargainPromotionEdit',
        //     name: '编辑砍价活动',
        //     component: resolve => require(['@/views/Pages/PromotionManagement/BargainPromotionEdit'], resolve)
        //   },
        {
            path: '/GiftPromotionDetail/:id/:auth',
            name: '赠送类促销详情',
            component: resolve => require(['@/views/Pages/PromotionManagement/GiftPromotionDetail'], resolve)
          }, {
            path: '/GiftPromotionCreate',
            name: '创建赠送类促销',
            component: resolve => require(['@/views/Pages/PromotionManagement/GiftPromotionCreate'], resolve)
          }, {
            path: '/ComplexPromotionInfo/:id',
            name: '组合类促销详情',
            component: resolve => require(['@/views/Pages/PromotionManagement/ComplexPromotionInfo'], resolve)
          }, {
            path: '/FullPromotionCreate',
            name: '创建满额促销',
            component: resolve => require(['@/views/Pages/PromotionManagement/FullPromotionCreate'], resolve)
          },  {
            path: '/FullPromotionDetailNew/:id/:auth',
            name: '满额促销详情',
            component: resolve => require(['@/views/Pages/PromotionManagement/FullPromotionDetailNew'], resolve)
    },
        {
          path: '/SeckillPromotionAdd/:promotionId/:auth/:active',
          name: '创建秒杀活动',
          component: resolve => require(['@/views/Pages/PromotionManagement/SeckillPromotionAdd'], resolve)
        },
      {
          path: '/XofferPromotionDetail/:id/:auth',
          name: '单品X件活动详情',
          component: resolve => require(['@/views/Pages/PromotionManagement/XofferPromotionDetail'], resolve)
        }, {
            path: '/XofferPromotionEdit',
            name: '单品X件活动编辑',
            component: resolve => require(['@/views/Pages/PromotionManagement/XofferPromotionEdit'], resolve)
         },
      {
            path: '/SeckillDetail/:promotionId',
            name: '秒杀详情',
            component: resolve => require(['@/views/Pages/PromotionManagement/SeckillDetail'], resolve)
          },
      //{
        //     path: '/FullNumPromotionAddNew',
        //     name: '创建满量促销',
        //     component: resolve => require(['@/views/Pages/PromotionManagement/FullNumPromotionAddNew'], resolve)
        //   },{
        //     path: '/FullNumPromotionDetailNew',
        //     name: '满量促销详情',
        //     component: resolve => require(['@/views/Pages/PromotionManagement/FullNumPromotionDetailNew'], resolve)
        //   }, {
        //     path: '/IncreasePromotionCreate',
        //     name: '创建换购促销',
        //     component: resolve => require(['@/views/Pages/PromotionManagement/IncreasePromotionCreate'], resolve)
        //   },  {
        //     path: '/IncreasePromotionDetail/:id/:auth',
        //     name: '换购促销详情',
        //     component: resolve => require(['@/views/Pages/PromotionManagement/IncreasePromotionDetail'], resolve)
        // },
        {
            path: '/xofferPromotionCreate',
            name: '创建单品X件优惠活动',
            component: resolve => require(['@/views/Pages/PromotionManagement/XofferPromotionCreate'], resolve)
          },
        {
          path: '/GroupActivityComponentsNew',
          name: '创建拼团活动',
          component: resolve => require(['@/views/Pages/PromotionManagement/GroupActivityComponentsNew'], resolve)
        },
        {
          path: '/LotteryRuleEventCopy/:id/:auth',
          name: '创建抽奖活动',
          component: resolve => require(['@/views/Pages/PromotionManagement/LotteryRuleEventCopy'], resolve)
        },
        {
          path: '/CouponComponents/:promotionId/:active',
          name: '编辑优惠券',
          component: resolve => require(['@/views/Pages/PromotionManagement/CouponComponents'], resolve)
        },
        //{
        //     path: '/RedEnvelopeComponents/:promotionId/:active',
        //     name: '编辑红包',
        //     component: resolve => require(['@/views/Pages/PromotionManagement/RedEnvelopeComponents'], resolve)
        // }, {
        //     path: '/RedEnvelopeDetail',
        //     name: '红包详情',
        //     component: resolve => require(['@/views/Pages/PromotionManagement/RedEnvelopeDetail'], resolve)
        //},
        {
          path: '/CouponDetail',
          name: '优惠券详情',
          component: resolve => require(['@/views/Pages/PromotionManagement/CouponDetail'], resolve)
        },
        //  {
        //     path: '/OverlayPromotion/Index',
        //     name: '叠加管理',
        //     component: resolve => require(['@/views/Pages/PromotionManagement/OverlayPromotion/Index'], resolve)
        //   }, {
        //     path: '/OverlayPromotion/add',
        //     name: '添加叠加管理',
        //     component: resolve => require(['@/views/Pages/PromotionManagement/OverlayPromotion/add'], resolve)
        //   },
        // {
        //   path: '/mutexProductTable',
        //   name: '互斥商品Table',
        //   component: resolve => require(['@/views/Pages/PromotionManagement/components/MutexProductTable.vue'], resolve)
        // },
        // ===============================营销模块，打包发布的时候，需要释放 updated by tzc at 2020-10-15 10:10:48 end==================================

        {
          path: "/ReceiptDetail",
          name: "采购收货单详情",
          component: resolve =>
            require(["@/views/Pages/Procurement/ReceiptDetail"], resolve)
        },
        {
          path: "/UnReceiptDetail",
          name: "无采购收货单详情",
          component: resolve =>
            require(["@/views/Pages/Procurement/UnReceiptDetail"], resolve)
        },
/*

        { path: '/MCategoryDetail/',
          name: '获取类目节点详情',
          component: resolve =>
            require(['@/views/Pages/Demo/MCategoryDetail'], resolve)
        },
*/
        {
          path: "/ReturnDetail",
          name: "新建退货单",
          component: resolve =>
            require(["@/views/Pages/Procurement/ReturnDetail"], resolve)
        },
        {
          path: "/AddProviderManage",
          name: "新增供应商",
          component: resolve =>
            require(["@/views/Pages/Procurement/addProviderManage"], resolve)
        },

       /* {
          path: "/RefundList/:afterSaleNo",
          name: "退款审核",
          component: resolve =>
            require(["@/views/Pages/OrderCenter/RefundList"], resolve)
        },
        {
          path: "/MerchantList",
          name: "退款审核",
          component: resolve =>
            require(["@/views/Pages/BusinessCenter/MerchantList"], resolve)
        },*/
        {
          path: "/PurchaseOrderDetail",
          name: "新增采购单",
          component: resolve =>
            require(["@/views/Pages/Procurement/PurchaseOrderDetail"], resolve)
        },
        {
          path: "/PurchaseOrder",
          name: "采购单",
          component: resolve =>
            require(["@/views/Pages/Procurement/PurchaseOrder"], resolve)
        },
        {
          path: "/contractEdit",
          name: "编辑采购合同",
          component: resolve => require(["@/views/Paje/ContractEdit"], resolve)
        },
        {
          path: "/NewContractList",
          name: "采购合同调价单",
          component: resolve =>
            require(["@/views/Paje/NewContractList"], resolve)
        },
        {
          path: "/NewPurchaseOrder",
          name: "新增采购单",
          component: resolve =>
            require(["@/views/Pages/Procurement/PurchaseOrderDetail"], resolve)
        },
        {
          path: "/NewNoContractPurchaseOrder",
          name: "新增无采购收货单",
          component: resolve =>
            require([
              "@/views/Pages/Procurement/NoContractPurchaseOrderDetail"
            ], resolve)
        },
        {
          path: "/OrderDetail/:orderNo",
          name: "订单详情",
          component: resolve =>
            require(["@/views/Pages/orderDetailsPages/OrderDetail"], resolve)
        },
        {
          path: "/OrderDeliveryDetails2/:deliverNo",
          name: "订单详情",
          component: resolve =>
            require([
              "@/views/Pages/orderDetailsPages/OrderDeliveryDetails2"
            ], resolve)
        },
        {
          path: "/OrderDeliveryDetails/:deliverNo",
          name: "订单发货详情",
          component: resolve =>
            require([
              "@/views/Pages/orderDetailsPages/OrderDeliveryDetails"
            ], resolve)
        },
        {
          path: "/AftersaleOrderDetail/:afterSaleNo",
          name: "售后单详情",
          component: resolve =>
            require(["@/views/Order/AftersaleOrderDetail"], resolve)
        },
        {
          path: "/MerchantEditPage/:cid/:isNode/:isShow",
          name: "商户信息(微零售)",
          component: resolve =>
            require(["@/views/Pages/BusinessCenter/MerchantEditPage"], resolve)
        },
        {
          path: "/MerchantEditWork/:cid/:isShow",
          name: "商户信息页(作业室)",
          component: resolve =>
            require(["@/views/Pages/BusinessCenter/MerchantEditWork"], resolve)
        },
        {
          path: "/MerchantBasicInfo/:cid/:isNode/:isShow",
          name: "商户详情",
          component: resolve =>
            require(["@/views/Pages/BusinessCenter/MerchantBasicInfo"], resolve)
        },
        {
          path: "/ProductCategoryEdit/:categoryId/:type",
          name: "类目编辑",
          component: resolve =>
            require(["@/views/Pages/Product/ProductCategoryEdit"], resolve)
        },
        {
          path: "/StoreInfoEdit/:id/:merchantId/:isDetail",
          name: "学校编辑页面",
          component: resolve =>
            require(["@/views/Pages/BusinessCenter/StoreInfoEdit"], resolve)
        },
        {
          path: "/ProductInfo/:productId",
          name: "商品详情",
          component: resolve =>
            require(["@/views/Pages/Product/ProductInfo"], resolve)
        },
        {
          path: "/BatchAddProduct/",
          name: "批量新增商品",
          component: resolve =>
            require(["@/views/Pages/Product/BatchAddProduct"], resolve)
        },
        {
          path: "/ProductUploadHistory/",
          name: "商品上传历史",
          component: resolve =>
            require(["@/views/Pages/Product/ProductUploadHistory"], resolve)
        },
        {
          path: "/BusinessProductInfo/:productId",
          name: "商家商品详情",
          component: resolve =>
            require(["@/views/Pages/Product/BusinessProductInfo"], resolve)
        },
        {
          path: "/BusinessProductDistribution",
          name: "商家商品分配",
          component: resolve =>
            require([
              "@/views/Pages/Product/BusinessProductDistribution"
            ], resolve)
        },
        {
          path: "/ProductDistribution",
          name: "店铺商品分配",
          component: resolve =>
            require(["@/views/Pages/Product/ProductDistribution"], resolve)
        },
        {
          path: "/MIndexProductShow",
          name: "装修页",
          component: resolve =>
            require(["@/views/Pages/Configuration/MIndexProductShow"], resolve)
        },
        /*{
          path: "/OperationLog",
          name: "操作日志",
          component: resolve =>
            require(["@/views/Pages/Point/OperationLog"], resolve)
        },
        {
          path: "/UploadPictures",
          name: "上传图片",
          component: resolve =>
            require(["@/views/Pages/Point/UploadPictures"], resolve)
        },
        {
          path: "/ArticleClassify",
          name: "文档分类",
          component: resolve =>
            require(["@/views/Pages/Point/ArticleClassify"], resolve)
        },*/

        /*PC 装修页 added by taozhouchuan at 2020-4-29 20:56:08*/
        {
          path: "/PcCmsTemplateList",
          name: "PC装修页",
          component: resolve =>
            require([
              "@/views/Pages/Configuration/Pc/PcCmsTemplateList"
            ], resolve)
        },
        {
          path: "/PcCmsConfigList",
          name: "PC配置页",
          component: resolve =>
            require(["@/views/Pages/Configuration/Pc/PcCmsConfigList"], resolve)
        },
        {
          path: "/GrouponStartMgmDetail",
          name: "开团活动详情",
          component: resolve =>
            require(["@/views/Paje/Market/GrouponStartMgmDetail"], resolve)
        },
        {
          path: "/GrouponStartMgm",
          name: "开团管理",
          component: resolve =>
            require(["@/views/Paje/Market/GrouponStartMgm"], resolve)
        },
        {
          path:
            "/pages/MarketingTools/LargeTurntable/LargeTurntablePreview/:id",
          name: "预览",
          component: resolve =>
            require([
              "@/views/Pages/MarketingTools/LargeTurntable/LargeTurntablePreview"
            ], resolve)
        },
        {
          path: "/pages/MarketingTools/LargeTurntable/LargeTurntableCreate/:id",
          name: "创建模板",
          component: resolve =>
            require([
              "@/views/Pages/MarketingTools/LargeTurntable/LargeTurntableCreate"
            ], resolve)
        },
        {
          path: "/SysRoleAdd/:id/:types/:view",
          name: "添加角色",
          component: resolve =>
            require(["@/views/Pages/Sys/SysRoleAdd"], resolve)
        },
        {
          path: "/getMStoreOperateDetail/:id/:type",
          name: "库内事务单据详情",
          component: resolve =>
            require(["@/views/Pages/Store/MStoreOperateDetail"], resolve)
        },
        {
          path: "/getMStoreUpdate/:id",
          name: "实体仓库编辑",
          component: resolve =>
            require(["@/views/Pages/Store/MStoreUpdate"], resolve)
        },
        {
          path: "/getMStoreDetail/:id",
          name: "实体仓库详情",
          component: resolve =>
            require(["@/views/Pages/Store/MStoreDetail"], resolve)
        },
        {
          path: "/getMstoreVirtualDetail/:id/:flag",
          name: "虚拟仓库详情",
          component: resolve =>
            require(["@/views/Pages/Store/MStoreVirtualDetail"], resolve)
        },
        {
          path: "/UserInfo/:id/:isShow",
          name: "会员详情",
          component: resolve =>
            require(["@/views/Pages/Member/UserInfo"], resolve)
        },
        {
          path: "/IntegraRuleAdd/",
          name: "积分获取新增",
          component: resolve =>
            require([
              "@/views/Pages/Member/IntegraRule/IntegraRuleAdd"
            ], resolve)
        },
        {
          path: "/IntegraRuleUpdate/:ruleId/:ruleType/:ruleMode",
          name: "积分获取编辑",
          component: resolve =>
            require([
              "@/views/Pages/Member/IntegraRule/IntegraRuleUpdate"
            ], resolve)
        },
        {
          path: "/ConsumeRuleAdd/",
          name: "积分消耗新增",
          component: resolve =>
            require([
              "@/views/Pages/Member/IntegraRule/ConsumeRuleAdd"
            ], resolve)
        },
        {
          path: "/ConfActivityRuleDetailTemplateDetail/",
          name: "积分规则模板编辑",
          component: resolve =>
            require([
              "@/views/Pages/Point/ConfActivityRuleDetailTemplateDetail"
            ], resolve)
        },
        {
          path: "/ConsumeRuleUpdate/:ruleId/:ruleType/:ruleMode",
          name: "积分消耗编辑",
          component: resolve =>
            require([
              "@/views/Pages/Member/IntegraRule/ConsumeRuleUpdate"
            ], resolve)
        },
        {
          path: "/IntegraRuleInfo/:ruleId/:ruleType/:obtainMode/:consumeMode",
          name: "积分查看",
          component: resolve =>
            require([
              "@/views/Pages/Member/IntegraRule/IntegraRuleInfo"
            ], resolve)
        },
        {
          path: "/getMStoreCheckDetail/:id/:checkStatus",
          name: "盘点详情",
          component: resolve =>
            require(["@/views/Pages/Store/MStoreCheckDetail"], resolve)
        },
        {
          path: "/getMstoreVirtualDetail/:id",
          name: "虚拟仓库详情",
          component: resolve =>
            require(["@/views/Pages/Store/MStoreVirtualDetail"], resolve)
        },
        {
          path: "/PowerTemplate",
          name: "配置权益",
          component: resolve =>
            require(["@/views/Pages/MemberCenter/Power/PowerTemplate"], resolve)
        },
        {
          path: "/PowerVipTemplate",
          name: "配置权益",
          component: resolve =>
            require([
              "@/views/Pages/MemberCenter/Power/PowerVipTemplate"
            ], resolve)
        },
        {
          path: "/PowerLookTemplate",
          name: "查看权益",
          component: resolve =>
            require([
              "@/views/Pages/MemberCenter/Power/PowerLookTemplate"
            ], resolve)
        },
        {
          path: "/PowerLookVipTemplate",
          name: "查看权益",
          component: resolve =>
            require([
              "@/views/Pages/MemberCenter/Power/PowerLookVipTemplate"
            ], resolve)
        },
        {
          path: "/AddPower",
          name: "添加权益",
          component: resolve =>
            require(["@/views/Pages/MemberCenter/Power/AddPower"], resolve)
        },
        {
          path: "/LookPowerTemplate",
          name: "查看",
          component: resolve =>
            require([
              "@/views/Pages/MemberCenter/Power/LookPowerTemplate"
            ], resolve)
        },
        {
          path: "/EditPowerTemplate",
          name: "编辑",
          component: resolve =>
            require([
              "@/views/Pages/MemberCenter/Power/EditPowerTemplate"
            ], resolve)
        },
        {
          path: "/pages/DiscountCard/DiscountCardCreate/:id",
          name: "创建折扣卡",
          component: resolve =>
            require(["@/views/Pages/DiscountCard/DiscountCardCreate"], resolve)
        },
        {
          path: "/pages/DiscountCard/DiscountCardDetail/:id",
          name: "查看折扣卡规则",
          component: resolve =>
            require(["@/views/Pages/DiscountCard/DiscountCardDetail"], resolve)
        },
        {
          path: "/pages/DiscountCard/DiscountCardBinding/:id",
          name: "查看折扣卡",
          component: resolve =>
            require(["@/views/Pages/DiscountCard/DiscountCardBinding"], resolve)
        },
        {
          path: "/pages/AutoMarket/UserJourneyManagement/SetRule",
          name: "创建用户旅程",
          component: resolve =>
            require([
              "@/views/Pages/AutoMarket/UserJourneyManagement/SetRule"
            ], resolve)
        },
        {
          path: "/pages/AutoMarket/UserJourneyManagement/SetPath",
          name: "创建用户旅程二",
          component: resolve =>
            require([
              "@/views/Pages/AutoMarket/UserJourneyManagement/SetPath"
            ], resolve)
        },
        {
          path: "/pages/AutoMarket/UserJourneyManagement/SetDown",
          name: "创建用户旅程第三步",
          component: resolve =>
            require([
              "@/views/Pages/AutoMarket/UserJourneyManagement/SetDown"
            ], resolve)
        },

        {
          path: "/pages/AutoMarket/UserJourneyManagement/checkJourney",
          name: "查看旅程",
          component: resolve =>
            require([
              "@/views/Pages/AutoMarket/UserJourneyManagement/checkJourney"
            ], resolve)
        },
        {
          path: "/AddUserGroup/:userGroupId",
          name: "用户分组管理",
          component: resolve =>
            require([
              "@/views/Pages/AutoMarket/UserGroupManagement/AddUserGroup"
            ], resolve)
        },
        {
          path: "/LookUserGroup/:userGroupId",
          name: "查看用户分组",
          component: resolve =>
            require([
              "@/views/Pages/AutoMarket/UserGroupManagement/LookUserGroup"
            ], resolve)
        },
        {
          path: "/LookUser/:userGroupId",
          name: "查看用户",
          component: resolve =>
            require([
              "@/views/Pages/AutoMarket/UserGroupManagement/LookUser"
            ], resolve)
        },
        {
          path: "/MemberLegalRule",
          name: "编辑",
          component: resolve =>
            require([
              "@/views/Pages/MemberCenter/Power/MemberLegalRule"
            ], resolve)
        },
        {
          path: "/SetLabelTemplate",
          name: "设置标签",
          component: resolve =>
            require(["@/views/Pages/Member/SetLabelTemplate"], resolve)
        },
        {
          path: "/DelLabelTemplate",
          name: "删除标签",
          component: resolve =>
            require(["@/views/Pages/Member/DelLabelTemplate"], resolve)
        },
        {
          path: "/MemDrainageCreate/:id",
          name: "创建引流规则",
          component: resolve =>
            require([
              "@/views/Pages/Member/MemDrainage/MemDrainageCreate.vue"
            ], resolve)
        },
        {
          path: "/MemDrainfeDetail/:id",
          name: "引流规则详情",
          component: resolve =>
            require([
              "@/views/Pages/Member/MemDrainage/MemDrainfeDetail.vue"
            ], resolve)
        },
        {
          path: "/InfomationAdd",
          name: "新增消息",
          component: resolve =>
            require(["@/views/Pages/User/InfomationAdd"], resolve)
        },
        {
          path: "/InfomationEdit",
          name: "编辑消息",
          component: resolve =>
            require(["@/views/Pages/User/InfomationAdd"], resolve)
        },
        {
          path: "/InfomationDetail",
          name: "查看消息",
          component: resolve =>
            require(["@/views/Pages/User/InfomationAdd"], resolve)
        },
        {
          path: "/AddMemberGrowth",
          name: "添加成长值",
          component: resolve =>
            require(["@/views/Pages/User/AddMemberGrowth"], resolve)
        },
        {
          path: "/EditMemberGrowth",
          name: "编辑成长值",
          component: resolve =>
            require(["@/views/Pages/User/EditMemberGrowth"], resolve)
        },
        {
          path: "/LookMemberGrowth",
          name: "查看成长值",
          component: resolve =>
            require(["@/views/Pages/User/LookMemberGrowth"], resolve)
        },
        {
          path: "/getContactsManageDetail/:id",
          name: "获取联系人管理详情",
          component: resolve =>
            require(["@/views/Supplier/ContactsManageDetail"], resolve)
        },
        {
          path: "/getContractManageDetail/:id",
          name: "获取合同管理详情",
          component: resolve =>
            require(["@/views/Supplier/ContractManageDetail"], resolve)
        },
        {
          path: "/getDeliveryOrderManageDetail/:id",
          name: "获取交货单管理详情",
          component: resolve =>
            require(["@/views/Supplier/DeliveryOrderManageDetail"], resolve)
        },
        {
          path: "/getDeliveryOrderManageWarehouseDetail/:id",
          name: "获取交货单管理(仓库物流)详情",
          component: resolve =>
            require([
              "@/views/Supplier/DeliveryOrderManageWarehouseDetail"
            ], resolve)
        },
        {
          path: "/getDirectDeliveryOrderPrDetail/:id",
          name: "获取直送订单（PR）详情",
          component: resolve =>
            require(["@/views/Supplier/DirectDeliveryOrderPrDetail"], resolve)
        },
        //京东商品管理
        {
          path: '/MProductDetail/',
          name: '京东商品管理',
          component: resolve =>
            require(['@/views/Pages/Product/MProductDetail'], resolve) },


        { path: '/ConfPlatformReconciliationDetail/', name: '平台对账表', component: resolve => require(['@/views/Pages/Point/ConfPlatformReconciliationDetail'], resolve) },
        {
          path: "/getDirectDeliveryOrderManageDetail/:id",
          name: "获取直送单管理详情",
          component: resolve =>
            require([
              "@/views/Supplier/DirectDeliveryOrderManageDetail"
            ], resolve)
        },
        {
          path: "/getInvoicePaymentInfoDetail/:id",
          name: "获取发票&付款信息详情",
          component: resolve =>
            require(["@/views/Supplier/InvoicePaymentInfoDetail"], resolve)
        },
        {
          path: "/getPaymentInfoDetail/:id",
          name: "获取付款信息详情",
          component: resolve =>
            require(["@/views/Supplier/PaymentInfoDetail"], resolve)
        },
        {
          path: "/getPurchaseOrderPoDetail/:id",
          name: "获取采购订单(PO)详情",
          component: resolve =>
            require(["@/views/Supplier/PurchaseOrderPoDetail"], resolve)
        },
        {
          path: "/getQualificationsManageDetail/:productCode/:isView",
          name: "获取资质管理详情",
          component: resolve =>
            require(["@/views/Supplier/QualificationsManageDetail"], resolve)
        },
        {
          path: "/getSalesOrderReportDetail/:id",
          name: "获取销售单报表查询详情",
          component: resolve =>
            require(["@/views/Supplier/SalesOrderReportDetail"], resolve)
        },
        {
          path: "/getSupplierDeliveryInfoReportDetail/:id",
          name: "获取供应商交货信息报表详情",
          component: resolve =>
            require([
              "@/views/Supplier/SupplierDeliveryInfoReportDetail"
            ], resolve)
        },
        {
          path: "/getSupplierEnterpriseInfoDetail/",
          name: "获取企业信息详情",
          component: resolve =>
            require(["@/views/Supplier/SupplierEnterpriseInfoDetail"], resolve)
        },
        {
          path: "/getSupplierPurchaseOrderReportDetail/:id",
          name: "获取供应商采购单报表详情",
          component: resolve =>
            require([
              "@/views/Supplier/SupplierPurchaseOrderReportDetail"
            ], resolve)
        },
        {
          path: "/getPurchaseOrderDetail/:id/:type",
          name: "采购单详情",
          component: resolve =>
            require(["@/views/Pages/Procurement/PurchaseOrderDetail"], resolve)
        },
        {
          path: "/SupplierRangeManageDetail",
          name: "供应商范围管理编辑",
          component: resolve =>
            require(["@/views/Supplier/SupplierRangeManageDetail"], resolve)
        },
        {
          path: "/getNoPurchaseOrderDetail/:id",
          name: "无采购收货单详情",
          component: resolve =>
            require([
              "@/views/Pages/Procurement/NoPurchaseOrderDetail"
            ], resolve)
        },
        {
          path: "/MStoreStockWarningDetail",
          name: "库存产品预警配置",
          component: resolve =>
            require(["@/views/Pages/Store/MStoreStockWarningDetail"], resolve)
        },
        {
          path: "/MStoreOperateAllocationDetail/:id/:type",
          name: "仓库调拨单详情",
          component: resolve =>
            require([
              "@/views/Pages/Store/MStoreOperateAllocationDetail"
            ], resolve)
        },
        {
          path: "/PurchasePriceDetail/",
          name: "采购价格详情",
          component: resolve =>
            require(["@/views/Pages/Procurement/PurchasePriceDetail"], resolve)
        },
        {
          path: "/DistributionMemberDetail",
          name: "代销员销售订单报表",
          component: resolve =>
            require([
              "@/views/Paje/Distribution/DistributionMemberDetail"
            ], resolve)
        },

        //added by tzc at 2020-10-12 01:57:10
        {
          path: "/BudgReportPointNormalDetail/",
          name: "获取报表统计详情",
          component: resolve =>
            require([
              "@/views/Pages/Point/BudgReportPointNormalDetail"
            ], resolve)
        },
        {
          path: "/BudgPlatformApplyDetail/",
          name: "获取平台预算详情",
          component: resolve =>
            require([
              "@/views/Pages/Point/BudgPlatformApplyDetail"
            ], resolve)
        },
        {
          path: "/ConfActivityRuleDetail/",
          name: "获取活动规则主表详情",
          component: resolve =>
            require(["@/views/Pages/Point/ConfActivityRuleDetail"], resolve)
        },
        {
          path: "/ConfActivityRuleLogDetail/",
          name: "获取活动规则流水日志表详情",
          component: resolve =>
            require(["@/views/Pages/Point/ConfActivityRuleLogDetail"], resolve)
        },
        {
          path: "/ConfActivityRuleDetailDetail/",
          name: "获取活动规则详情信息详情",
          component: resolve =>
            require([
              "@/views/Pages/Point/ConfActivityRuleDetailDetail"
            ], resolve)
        },
        {
          path: "/ConfBdDetail/",
          name: "获取BD部门表详情",
          component: resolve =>
            require(["@/views/Pages/Point/ConfBdDetail"], resolve)
        },
        {
          path: "/ConfBdMoneyLogDetail/",
          name: "获取BD部门资金流水表详情",
          component: resolve =>
            require(["@/views/Pages/Point/ConfBdMoneyLogDetail"], resolve)
        },
        {
          path: "/ConfBdPlatfromRelaDetail/",
          name: "获取BD部门和平台关联表详情",
          component: resolve =>
            require(["@/views/Pages/Point/ConfBdPlatfromRelaDetail"], resolve)
        },
        {
          path: "/ConfBdPointLogDetail/",
          name: "获取部门积分流水表详情",
          component: resolve =>
            require(["@/views/Pages/Point/ConfBdPointLogDetail"], resolve)
        },
        {
          path: "/ConfPlatformDetail/",
          name: "获取子平台表详情",
          component: resolve =>
            require(["@/views/Pages/Point/ConfPlatformDetail"], resolve)
        },
        {
          path: "/ConfPlatformLogDetail/",
          name: "获取平台积分流水表详情",
          component: resolve =>
            require(["@/views/Pages/Point/ConfPlatformLogDetail"], resolve)
        },
        {
          path: "/ConfPointCardDetail/",
          name: "获取积分卡列表详情",
          component: resolve =>
            require(["@/views/Pages/Point/ConfPointCardDetail"], resolve)
        },
        {
          path: "/ConfPointCardApplyDetail/",
          name: "获取积分卡批量开卡申请表详情",
          component: resolve =>
            require(["@/views/Pages/Point/ConfPointCardApplyDetail"], resolve)
        },
        {
          path: "/ConfPointCardBatchDetail/",
          name: "获取积分卡批量开卡申请表详情",
          component: resolve =>
            require(["@/views/Pages/Point/ConfPointCardBatchDetail"], resolve)
        },
        {
          path: "/ConfPointCardLogDetail/",
          name: "获取积分卡流水表详情",
          component: resolve =>
            require(["@/views/Pages/Point/ConfPointCardLogDetail"], resolve)
        },

        {
          path: "/ConfSupplierDetail/",
          name: "获取供应商主表详情",
          component: resolve =>
            require(["@/views/Pages/Point/ConfSupplierDetail"], resolve)
        },
        {
          path: "/ConfSupplierLogDetail/",
          name: "获取供应商流水表详情",
          component: resolve =>
            require(["@/views/Pages/Point/ConfSupplierLogDetail"], resolve)
        },
        {
          path: "/ConfThirdPartDetail/",
          name: "获取第三方机构主表详情",
          component: resolve =>
            require(["@/views/Pages/Point/ConfThirdPartDetail"], resolve)
        },
        {
          path: "/ConfThirdPartLogDetail/",
          name: "获取第三方机构流水表详情",
          component: resolve =>
            require(["@/views/Pages/Point/ConfThirdPartLogDetail"], resolve)
        },
        {
          path: "/MoniInterfaceDetail/",
          name: "获取接口监控表详情",
          component: resolve =>
            require(["@/views/Pages/Point/MoniInterfaceDetail"], resolve)
        },
        {
          path: "/MoniRiskLogDetail/",
          name: "获取风控流水表详情",
          component: resolve =>
            require(["@/views/Pages/Point/MoniRiskLogDetail"], resolve)
        },
        {
          path: "/MoniRiskRuleDetail/",
          name: "获取风控规则主表详情",
          component: resolve =>
            require(["@/views/Pages/Point/MoniRiskRuleDetail"], resolve)
        },
        {
          path: "/PublMemberDetail/",
          name: "获取会员主表详情",
          component: resolve =>
            require(["@/views/Pages/Point/PublMemberDetail"], resolve)
        },
        {
          path: "/PublMemberBalanceDetail/",
          name: "获取会员台账表详情",
          component: resolve =>
            require(["@/views/Pages/Point/PublMemberBalanceDetail"], resolve)
        },
        {
          path: "/PublMemberLogDetail/",
          name: "获取会员积分流水表详情",
          component: resolve =>
            require(["@/views/Pages/Point/PublMemberLogDetail"], resolve)
        },
        {
          path: "/SettSupplierBalanceDetail/",
          name: "获取供应商结算台账表详情",
          component: resolve =>
            require(["@/views/Pages/Point/SettSupplierBalanceDetail"], resolve)
        },
        {
          path: "/SettSupplierLogDetail/",
          name: "获取供应商结算记录表详情",
          component: resolve =>
            require(["@/views/Pages/Point/SettSupplierLogDetail"], resolve)
        },
        {
          path: "/SettSupplierRuleDetail/",
          name: "获取供应商结算规则详情",
          component: resolve =>
            require(["@/views/Pages/Point/SettSupplierRuleDetail"], resolve)
        },
        {
          path: "/MoniRiskRuleAdd/",
          name: "添加风控规则",
          component: resolve =>
            require(["@/views/Pages/Point/MoniRiskRuleAdd"], resolve)
        }
      ]
    },
    {
      path: "/login",
      name: "登录",
      component: resolve => require(["@/views/Login"], resolve)
    },
    {
      path: "/MerchantLogin",
      name: "商家登录",
      component: resolve => require(["@/views/MerchantLogin"], resolve)
    },
    {
      path: "/MerchantsSettled",
      name: "商家入驻",
      component: resolve => require(["@/views/MerchantsSettled"], resolve)
    },
    {
      path: "/SupplierLogin",
      name: "供应商登录",
      component: resolve => require(["@/views/SupplierLogin"], resolve)
    },
    {
      path: '/MCategoryDetail/',
      name: '获取类目节点详情',
      component: resolve => require(['@/views/Pages/Product/MCategoryDetail'], resolve)
    },
    {
      path: "/SuppliersSettled",
      name: "供应商入驻",
      component: resolve => require(["@/views/SuppliersSettled"], resolve)
    },
    {
      path: "/404",
      name: "404",
      component: resolve => require(["@/views/Error/404"], resolve)
    },
    {
      path: "/terminal",
      name: "抽奖终端",
      component: resolve =>
        require([
          "@/views/Pages/MarketingTools/LargeTurntable/terminal"
        ], resolve)
    },

    {
      path: '/ReportActivityRuleDetail',
      name: '获取活动规则报表详情',
      component: resolve =>
        require([
        '@/views/Pages/Point/ReportActivityRuleDetail'
      ], resolve)
    },
    {
      path: '/ReportBdDetail',
      name: '获取BD部门报表详情',
      component: resolve => require(['@/views/Pages/Point/ReportBdDetail'], resolve)
    },
    {
      path: '/ReportPlatformDetail',
      name: '获取平台报表详情',
      component: resolve => require(['@/views/Pages/Point/ReportPlatformDetail'], resolve)
    },
    {
      path: '/ReportSupplierDetail',
      name: '获取供应商报表详情',
      component: resolve => require(['@/views/Pages/Point/ReportSupplierDetail'], resolve)
    },
    {
      path: '/ReportThirdPartDetail',
      name: '获取第三方机构报表详情',
      component: resolve => require(['@/views/Pages/Point/ReportThirdPartDetail'], resolve)
    },
    { path: '/PromotionWarningDetail/', name: '获取详情', component: resolve => require(['@/views/Pages/PromotionManagement/PromotionWarningDetail'], resolve) },

    { path: '/ConfBdReconciliationApplyDetail/', name: '获取修改bd部门对账申请表详情', component: resolve => require(['@/views/Pages/Point/ConfBdReconciliationApplyDetail'], resolve) },
    { path: '/ConfBdReconciliationLogDetail/', name: '获取修改bd部门对账流水表详情', component: resolve => require(['@/views/Pages/Point/ConfBdReconciliationLogDetail'], resolve) },
    { path: '/ConfPlatformReconciliationApplyDetail/', name: '获取修改平台对账申请表详情', component: resolve => require(['@/views/Pages/Point/ConfPlatformReconciliationApplyDetail'], resolve) },
    { path: '/ConfPlatformReconciliationLogDetail/', name: '获取修改平台对账流水表详情', component: resolve => require(['@/views/Pages/Point/ConfPlatformReconciliationLogDetail'], resolve) },


    { path: '/BusinessProduct/', name: '获取修改平台对账流水表详情', component: resolve => require(['@/views/Pages/Product/BusinessProduct'], resolve) },
    { path: '/AddOrUpdateProduct/', name: '获取修改平台对账流水表详情', component: resolve => require(['@/views/Pages/Product/AddOrUpdateProduct'], resolve) },

    {
      path: '/BusinessProduct/',
      name: '积分商品管理',
      component: resolve => require(['@/views/Pages/Product/BusinessProduct'], resolve)
    },

    {
      path: '/AddOrUpdateProduct/',
      name: '积分商品管理',
      component: resolve => require(['@/views/Pages/Product/AddOrUpdateProduct'], resolve)
    },

    // {
    //   path: '/MConfigurationCmsDetail/',
    //   name: 'H5页面配置',
    //   component: resolve => require(['@/views/Pages/Product/MConfigurationCmsDetail'], resolve)
    // },

    /*{
      path: '/AccountsDetail/',
      name: '公众号类型设置',
      component: resolve => require(['@/views/Pages/Product/AccountsDetail'], resolve)
    },*/



  ]
});

router.beforeEach((to, from, next) => {
  // 登录界面登录成功之后，会把用户信息保存在会话
  // 存在时间为会话生命周期，页面关闭即失效。
  let token = localStorage.getItem("token");
  let userId = localStorage.getItem("id");
  if (
    to.path === "/login" ||
    to.path === "/MerchantLogin" ||
    to.path === "/MerchantsSettled" ||
    to.path === "/SupplierLogin" ||
    to.path === "/SuppliersSettled"
  ) {
    // 如果是访问登录界面，如果用户会话信息存在，代表已登录过，跳转到主页
    if (token) {
      next({path: "/"});
    } else {
      next();
    }
  } else {
    var isFilter = true;
    $.each(white_url, function (key, val) {
      if (val == to.path) {
        isFilter = false;
        return;
      }
    });
    if (!token && isFilter) {
      // 如果访问非登录界面，且户会话信息不存在，代表未登录，则跳转到登录界面
      next({path: "/login"});
    } else {
      if (isFilter) {
        // 加载动态菜单和路由
        addDynamicMenuAndRoutes(userId, to, from);
      }
      next();
    }
  }
});

/**
 * 加载动态菜单和路由
 */
function addDynamicMenuAndRoutes(userId, to, from) {
  // 处理IFrame嵌套页面
  handleIFrameUrl(to.path);

  if (store.state.app.menuRouteLoaded) {
    console.log("动态菜单和路由已经存在.");
    return;
  }

  // 保存加载状态
  store.commit("menuRouteLoaded", true);

  let that = this;

  utils.request.findRoleMenuTree({}, function (response) {
    var code = response.code;
    if (code == "0000") {
      if (response.data != null) {
      }
      //添加动态路由
      let dynamicRoutes = addDynamicRoutes(response.data.menuList);
      // 处理静态组件绑定路由
      handleStaticComponent(router, dynamicRoutes);
      router.addRoutes(router.options.routes);
      // 保存菜单树
      response.data.menuList.forEach((val, ind) => {
        val["number"] = ind;
        val["current"] = false;
      });
      store.commit("setNavTree", response.data.menuList);

      //保存按钮权限
      if (response.data.permsList != null) {
        store.commit("setPerms", response.data.permsList);
      }
    } else {
      // 保存加载状态
      store.commit("menuRouteLoaded", false);
    }
  });
}

/**
 * 处理路由到本地直接指定页面组件的情况
 * 比如'代码生成'是要求直接绑定到'Generator'页面组件
 */
function handleStaticComponent(router, dynamicRoutes) {
  for (let j = 0; j < dynamicRoutes.length; j++) {
    if (dynamicRoutes[j].name == "代码生成") {
      dynamicRoutes[j].component = Generator;
      break;
    }
  }
  router.options.routes[0].children = router.options.routes[0].children.concat(
    dynamicRoutes
  );
}

/**
 * 处理IFrame嵌套页面
 */
function handleIFrameUrl(path) {
  // 嵌套页面，保存iframeUrl到store，供IFrame组件读取展示
  let url = path;
  let length = store.state.iframe.iframeUrls.length;
  for (let i = 0; i < length; i++) {
    let iframe = store.state.iframe.iframeUrls[i];
    if (path != null && path.endsWith(iframe.path)) {
      url = iframe.url;
      store.commit("setIFrameUrl", url);
      break;
    }
  }
}

/**
 * 添加动态(菜单)路由
 * @param {*} menuList 菜单列表
 * @param {*} routes 递归创建的动态(菜单)路由
 */
function addDynamicRoutes(menuList = [], routes = []) {
  var temp = [];
  for (var i = 0; i < menuList.length; i++) {
    if (menuList[i].children && menuList[i].children.length >= 1) {
      temp = temp.concat(menuList[i].children);
    } else if (menuList[i].url && /\S/.test(menuList[i].url)) {
      menuList[i].url = menuList[i].url.replace(/^\//, "");
      // 创建路由配置
      var route = {
        path: menuList[i].url,
        component: null,
        name: menuList[i].name,
        meta: {
          icon: menuList[i].icon,
          index: menuList[i].id
        }
      };
      let path = getIFramePath(menuList[i].url);
      if (path) {
        // 如果是嵌套页面, 通过iframe展示
        route["path"] = path;
        route["component"] = resolve =>
          require([`@/views/IFrame/IFrame`], resolve);
        // 存储嵌套页面路由路径和访问URL
        let url = getIFrameUrl(menuList[i].url);
        let iFrameUrl = {path: path, url: url};
        store.commit("addIFrameUrl", iFrameUrl);
      } else {
        try {
          // 根据菜单URL动态加载vue组件，这里要求vue组件须按照url路径存储
          // 如url="sys/user"，则组件路径应是"@/views/sys/user.vue",否则组件加载不到
          let array = menuList[i].url.split("/");

          let url = "";
          for (let i = 0; i < array.length; i++) {
            url +=
              array[i].substring(0, 1).toUpperCase() +
              array[i].substring(1) +
              "/";
          }
          url = url.substring(0, url.length - 1);

          route["component"] = resolve => require([`@/views/${url}`], resolve);
        } catch (e) {
        }
      }
      routes.push(route);
    }
  }
  if (temp.length >= 1) {
    addDynamicRoutes(temp, routes);
  } else {
    //console.log('动态路由加载...')
    //console.log(routes)
    //console.log('动态路由加载完成.')
  }
  return routes;
}

export default router;
